#ifndef GAMEOBJECT_H
#define GAMEOBJECT_H

#include "String.h"
#include "Maths.h"
#include "RGBAColor.h"
#include "OpenGLRenderer.h"

class CGameObject
{
    
    public:
        
        //TODO: Constructors and destructor
        CGameObject() : m_fAngle(0), m_fAngVel(0), m_fTorque(0), 
                        m_fMass(1), m_fMomInertia(1), m_fSize(1), m_iTexture(0)
        {
            
            
            
        }
        
        virtual void update(Scalar fTimeStep)
        {
            
            //TODO: Replace cruddy Euler integration with something better
            m_vVel += m_vForce / m_fMass * fTimeStep;
            m_vPos += m_vVel * fTimeStep;
            m_vForce.Zero();
            
            m_fAngVel += m_fTorque / m_fMomInertia * fTimeStep;
            m_fAngle += m_fAngVel * fTimeStep;
            m_fTorque = 0;
            
        }
        
        virtual void draw();
        
        //TODO: Get and set functions for all properties
        
        String getName()        { return m_sName; }
        
        void setPos(Vector vPos)        { m_vPos = vPos; }
        void setVel(Vector vVel)        { m_vVel = vVel; }
        void setAngle(Scalar fAngle)    { m_fAngle = fAngle; }
        void setAngVel(Scalar fAngVel)  { m_fAngVel = fAngVel; }
        void setSize(Scalar fSize)      { m_fSize = fSize; }
        
    protected:
        
        String m_sName;
        
        Vector m_vPos, m_vVel, m_vForce;
        Scalar m_fAngle, m_fAngVel, m_fTorque;
        Scalar m_fMass, m_fMomInertia;
        Scalar m_fSize;
        
        GLuint m_iTexture;
        RGBAColor m_Color;
        
    private:
    
};

#endif //GAMEOBJECT_H
